package com.example;


import com.sun.tools.javap.TypeAnnotationWriter;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class greendao {
    public static void main(String[]args) {
        Schema schema = new Schema(1000, "com.lanou.greendao.entity");
        addFoodZine(schema);
        addFoodBean(schema);
        try {
            new DaoGenerator().generateAll(schema,"src_gen");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    private static void addFoodBean(Schema schema) {
        Entity note = schema.addEntity("FoodBean");
        note.addStringProperty("user_image").columnName("user_image").primaryKey();
        note.addStringProperty("picture_url").columnName("picture_url");
    }

    /**
     * 添加主题列表中的栏目实体类对象
     * 并生成对应的数据库表
     * */
    private static void addFoodZine(Schema schema) {
        Entity entity = schema.addEntity("FoodZines");
        entity.addStringProperty("user_image").columnName("user_image").primaryKey();
        entity.addStringProperty("user_name").columnName("user_name");
        entity.addStringProperty("picture_url").columnName("picture_url");
        entity.addStringProperty("foodzine_name").columnName("foodzine_name");
        entity.addStringProperty("serial_number").columnName("private String serial_number");
    }


}
